package com.zzq.mapper;

import com.zzq.pojo.FileDate;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FileMapper {

    @Insert("insert into file_metadata (business_id, file_name, url, upload_time) values (#{businessId}, #{fileName}, #{fileUrl}, now())")
    void add(FileDate fileDate) ;

    @Delete("delete from file_metadata where business_id = #{no}")
    void elect(int no);

    @Select("select url from file_metadata where business_id = #{businessId}")
    void  getUrlByBusinessId(String businessId);

    @Delete("delete from file_metadata where business_id = #{businessId}")
    void  deleteByBusinessId(int businessId);
}
